package io.lvdaxian.mybatis07.mapping;


import io.lvdaxian.mybatis07.session.Configuration;
import io.lvdaxian.mybatis07.type.JdbcType;

public class ParameterMapping {
  private Configuration configuration;
  
  // property 属性
  private String property;
  // java type
  private Class<?> javaType = Object.class;
  // jdbcType
  private JdbcType jdbcType;
  
  public ParameterMapping() {
  }
  
  public static class Builder {
    
    private final ParameterMapping parameterMapping = new ParameterMapping();
    
    public Builder(Configuration configuration, String property) {
      parameterMapping.configuration = configuration;
      parameterMapping.property = property;
    }
    
    public Builder javaType(Class<?> javaType) {
      parameterMapping.javaType = javaType;
      return this;
    }
    
    public Builder jdbcType(JdbcType jdbcType) {
      parameterMapping.jdbcType = jdbcType;
      return this;
    }
  }
  
  public Configuration getConfiguration() {
    return configuration;
  }
  
  public String getProperty() {
    return property;
  }
  
  public Class<?> getJavaType() {
    return javaType;
  }
  
  public JdbcType getJdbcType() {
    return jdbcType;
  }
}
